﻿using System;
using System.Web;

namespace jtbc.plus
{
    public class multilanguage : IHttpModule
    {
        public void Init(HttpApplication application)
        {
            application.BeginRequest += (s, e) => {
                HttpApplication app = (HttpApplication)s;
                HttpContext ctx = app.Context;

                if (config.nlng == "1")
                {
                    cookies.set("config-language", "english", 999999999);
                    config.default_template = "tpl_english";
                }
                else
                {
                    cookies.set("config-language", "chinese", 999999999);
                    config.default_template = "tpl_default";
                }
            };
        }

        public void Dispose()
        {
        }
    }
}
